package net.zhengxinyun.performance.mapper.Indicators;

import io.swagger.models.auth.In;
import net.zhengxinyun.performance.entity.TownIndicatorsEntity;
import net.zhengxinyun.performance.entity.TownScoreEntity;
import net.zhengxinyun.performance.filter.IndexFilter;
import net.zhengxinyun.performance.filter.TownIndicatorsFilter;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface TownIndicatorsEntityMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table inv_town_indicators
     *
     * @mbg.generated Mon Oct 29 17:43:18 CST 2018
     */
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table inv_town_indicators
     *
     * @mbg.generated Mon Oct 29 17:43:18 CST 2018
     */
    Long insert(TownIndicatorsEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table inv_town_indicators
     *
     * @mbg.generated Mon Oct 29 17:43:18 CST 2018
     */
    int insertSelective(TownIndicatorsEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table inv_town_indicators
     *
     * @mbg.generated Mon Oct 29 17:43:18 CST 2018
     */
    TownIndicatorsEntity selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table inv_town_indicators
     *
     * @mbg.generated Mon Oct 29 17:43:18 CST 2018
     */
    int updateByPrimaryKeySelective(TownIndicatorsEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table inv_town_indicators
     *
     * @mbg.generated Mon Oct 29 17:43:18 CST 2018
     */
    int updateByPrimaryKey(TownIndicatorsEntity record);

    List<TownIndicatorsFilter> query(TownIndicatorsFilter townIndicatorsFilter);

    /**
     * 获取总数据量
     * @param townIndicatorsFilter
     * @return
     */
    Integer queryForCount(TownIndicatorsFilter townIndicatorsFilter);

    /**
     * 根据id获取对象
     * @param id
     * @return
     */
//    TownIndicatorsFilter queryById(Long id);

    /**
     * 根据指标名和年份获取对应id
     * @param townIndicatorsEntity
     * @return
     */
    String queryIdBySuperName(TownIndicatorsEntity townIndicatorsEntity);

    TownIndicatorsFilter queryByNameAndTime(TownIndicatorsEntity townIndicatorsEntity);

    /**
     * 把指标表，乡镇表，得分表关联查询。
     * @param townIndicatorsFilter
     * @return
     */
    List<TownIndicatorsFilter> queryScoreByIndexId(TownIndicatorsFilter townIndicatorsFilter);

    /**
     * 求上个方法对应的总数据条数
     * @param townIndicatorsFilter
     * @return
     */
    Integer getThreeTableCount(TownIndicatorsFilter townIndicatorsFilter);

    int getAuditCount(TownIndicatorsFilter townIndicatorsFilter);

    /**
     * 为了批量审核通过查询做的
     * @param townIndicatorsFilter
     * @return
     */
    List<TownIndicatorsFilter> queryForPass(TownIndicatorsFilter townIndicatorsFilter);

    List<TownIndicatorsFilter> queryScoreForAudit(TownIndicatorsFilter townIndicatorsFilter);

    int deleteBySuperId(String superId);

    Integer queryNullFinal(TownIndicatorsEntity townIndicatorsEntity);

    Double queryFirstFinalScore(TownIndicatorsEntity townIndicatorsEntity);

    List<TownIndicatorsFilter> indexTown(IndexFilter indexFilter);

    List<TownIndicatorsFilter> queryWarn(TownIndicatorsFilter townIndicatorsFilter);
}